<template>
  <div class="base-card">
    <div class="card-head" v-if="$slots.header" :style="borderStyle">
      <slot name="header"></slot>
    </div>
    <slot></slot>
  </div>
</template>

<script setup>
const props = defineProps({
  showHeadBorder: {
    type: Boolean,
    default: true,
  },
});
const borderStyle = computed(() => {
  return props.showHeadBorder
    ? { borderBottom: "1px solid #e4e7ed" }
    : { border: "none" };
});
</script>

<style scoped lang="scss">
.base-card {
  padding: 20px;
  background: blue url("@/assets/images/visualization/bg.png") no-repeat left top ;
  background-size: 100% 100%;
  box-shadow: -1px 1px 4px 0px rgba(0, 0, 0, 0.11);
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  height: auto;
  .card-head {
    padding: 0 0 7px 0;
    // min-height: 40px;
    border-bottom: 1px solid #e4e7ed;
  }
}
</style>
